package com.lhn.spring5.lookupmethod;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

/**
 * 人类
 *
 * @author lhn
 * @date 2021/12/28 16:31
 * @since 1.0.0
 **/
public class Person {

    private BeanFactory beanFactory;

    private Man man;

    public Man createCommand() {
        return beanFactory.getBean("man", Man.class);
    }

    public Man getMan() {
        return man;
    }



    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Person{");
        sb.append("man=").append(man);
        sb.append('}');
        return sb.toString();
    }
}